#define   _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
int  find(int arr[], int del, int size)
{
	int i, j = 0;
	for (i = 0; i < size; i++)
	{
		if (arr[i] != del)
		{
			arr[j] = arr[i];
			j++;
		}
	}
	return j;
}

int main()
{
	enum 
	{
		num = 10
	};
	int del;
	int i;
	int arr[num];
	scanf("%d", &del);
	for (i = 0; i < num; i++)
		scanf("%d", &arr[i]);
	int size = sizeof(arr) / sizeof(arr[0]);
	int ret = find(arr, del, size);
	for (i = 0; i < ret; i++)
		printf("%d ", arr[i]);

	return 0;
}